import * as THREE from "three"
import * as $ from "jquery"
import { OBJECTS, GROUPS } from "../declarations.js"
import { ASSETS } from "../assets"
import { TOOLS } from "../tools/tools"
import { p } from "gsap/RoundPropsPlugin.js"

let actors, textures, materials, groups

let clock = new THREE.Clock()
let delta = 0

let GAME = {
  init: () => {

    actors = OBJECTS.actors
    groups = OBJECTS.groups



    
    //  console.log(groups.followCam)
  },



  onMouseDown: function (e) {
    e.preventDefault()
  },

  onMouseUp: function (e) {
    e.preventDefault()
  },

  tick: () => {
    delta = clock.getDelta()
    if (OBJECTS.cam_target) {

      OBJECTS.camera.lookAt(OBJECTS.cam_target)
      let p = OBJECTS.cam_target
      // console.log(p)
      groups.followCam.position.set(p.x, p.y, p.z)
    }
  },
}

export { GAME }
